import { formateDate } from '@/utils/tools'

export const useSearch = () => {
  const changeDate = (val, reg) => { // 日期选择器
    let dates = []
    if (val && val.length > 0) {
      dates = val.map(item => formateDate(item, reg))
    } else dates = ['', '']
    return dates
  }
  return {
    changeDate
  }
}